package com.tracking.application.fragments;

import android.app.Activity;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tracking.application.R;
import com.tracking.application.activities.MainApplicationActivity;

/**
 * Created with IntelliJ IDEA.
 * User: Kamil.O
 * Description: Start activity
 * Date: 20.11.13
 * Time: 01:46
 */
public class StartFragment extends Fragment {

    private MainApplicationActivity mainApplicationActivity;

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try {
            mainApplicationActivity = (MainApplicationActivity) activity;
        } catch(ClassCastException e) {
            throw new ClassCastException(activity.toString() + " must implement DataPullingInterface");
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.start_fragment, container, false);
        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
        mainApplicationActivity.checkSatelite();
        mainApplicationActivity.choiseStateButtons();
    }
}
